
body > header {
  position: relative;
  width: 100%;
  height: $settingsHeaderHeight;
  z-index: 3;

  div#logo {
    position: absolute;
    top: 18px;
    left: 24px;
    z-index: 2;

    > span {
      position: relative;
      display: block;
      width: 64px;
      height: 64px;
      background: img('icon/icon.png') no-repeat center / 40px;
      z-index: 3;
    }

    &::before, &::after {
      content: "";
      position: absolute;
      border-radius: 50%;
    }

    &::before {
      top: -4px;
      left: -4px;
      width: calc(100% + 8px);
      height: calc(100% + 8px);
      background: $gradient;
      box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
      z-index: 1;
    }

    &::after {
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: $settingsMenuBackground;
      z-index: 2;
    }
  }

  > h1 {
    @include mask('icon-settings', $textColorLight2, 22px);
    position: relative;
    display: inline-flex;
    font-size: 120%;
    padding: 0 30px 0 calc(#{$settingsMenuWidth} + 55px);
    color: $textColorLight2;
    background: $settingsMenuBackground;
    line-height: $settingsHeaderHeight;
    font-weight: $__fontWeightMedium;
    border-bottom-right-radius: 20px;

    &::before {
      -webkit-mask-position-x: calc(#{$settingsMenuWidth} + 15px);
    }

    &::after {
      content: "";
      position: absolute;
      top: 40px;
      left: calc(#{$settingsMenuWidth} - 10px);
      width: 50px;
      height: 50px;
      border-radius: 50%;
      border: 10px solid transparent;
      border-top-color: $settingsMenuBackground;
      transform: rotateZ(-45deg);
      pointer-events: none;
    }

    > span {
      cursor: pointer;

      + span {
        position: relative;
        margin-left: 24px;

        &::before {
          content: "";
          position: absolute;
          top: 0;
          bottom: 0;
          margin: auto;
          left: -14px;
          width: 0;
          height: 0;
          border: 5px solid transparent;
          border-left-color: $textColorLight;
        }
      }

      &:last-child {
        pointer-events: none;
      }
    }
  }

  &[data-type='dashboard'] > h1::before {
    @include maskImage('settings/icon-dashboard');
    -webkit-mask-size: 22px;
  }

  &[data-type='appearance'] > h1::before {
    @include maskImage('settings/icon-appearance');
    -webkit-mask-size: 22px;
  }

  &[data-type='newtab'] > h1::before {
    @include maskImage('settings/icon-newtab');
    -webkit-mask-size: 18px;
  }

  &[data-type='language'] > h1::before {
    @include maskImage('settings/icon-translate');
    -webkit-mask-size: 22px;
  }

  &[data-type='support'] > h1::before {
    @include maskImage('settings/icon-support');
    -webkit-mask-size: 24px;
  }

  &[data-type='infos'] > h1::before {
    @include maskImage('icon-info');
    -webkit-mask-size: 22px;
  }

  &[data-type='premium'] > h1::before {
    @include maskImage('icon-premium');
    -webkit-mask-size: 22px;
  }

  &[data-type='export'] > h1::before {
    @include maskImage('settings/icon-importExport');
    -webkit-mask-size: 26px;
  }

  > menu {
    display: inline-block;
    margin: 12px 0 0 40px;
    vertical-align: top;

    > li {
      display: inline-block;

      > button {
        position: relative;
        display: inline-block;
        vertical-align: top;
        border: 0;
        outline: 0;
        cursor: pointer;

        &.save {
          @extend %highlightButton;
          @include mask('icon-info', $textColorInverted, 21px);
          transition: box-shadow 1s, padding 0.5s;
          z-index: 2;

          &::before {
            -webkit-mask-position-x: 8px;
            @extend %hidden;
            transition: opacity 0.5s;
          }

          &.highlight {
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 0 120px $colorNotice;
          }

          &.info {
            padding-left: 34px;

            &::before {
              opacity: 1;
            }
          }
        }

        &.restore {
          @include mask('icon-update', $textColorLight, 24px);
          background: transparent;
          margin: 2px 0 0 10px;
          width: 24px;
          height: 24px;
        }

        &.hidden {
          display: none;
        }
      }
    }
  }
}

body > div.dialog {
  position: absolute;
  top: $settingsHeaderHeight;
  width: 300px;
  padding: 12px 10px;
  text-align: center;
  background: $contentBackground;
  margin-left: calc(-150px + 12px);
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
  transition: opacity 0.3s, transform 0.3s;
  transform: translate3d(0, -10px, 0);
  border-radius: 10px;
  z-index: 5;
  @extend %hidden;

  &.visible {
    @extend %visible;
    transform: translate3d(0, 0, 0);
  }

  &::before {
    content: "";
    position: absolute;
    border: 10px solid transparent;
    border-bottom-color: $contentBackground;
    top: -20px;
    left: 0;
    right: 0;
    margin: auto;
    width: 0;
    height: 0;
  }

  > p {
    line-height: 140%;
  }

  > a {
    position: relative;
    display: inline-block;
    color: $mainColor2;
    padding: 3px 5px 3px 15px;
    margin-bottom: 5px;
    font-weight: $__fontWeightMedium;
    cursor: pointer;

    &::before {
      content: "";
      position: absolute;
      top: 8px;
      left: 0;
      width: 7px;
      height: 7px;
      border-top: 2px solid $mainColor2;
      border-left: 2px solid $mainColor2;
      transform: rotateZ(135deg);
    }
  }

  > span {
    @include mask(null, $textColor, 16px);
    position: relative;
    display: inline-block;
    padding: 6px 10px 5px 30px;
    margin: 10px 0 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;

    &::before {
      width: 16px;
      left: 8px;
    }
  }

  &[data-type='behaviour'] > span::before {
    @include maskImage('icon-settings');
  }

  &[data-type='appearance'] > span::before {
    @include maskImage('settings/icon-appearance');
  }

  &[data-type='newtab'] > span::before {
    @include maskImage('settings/icon-newtab');
    -webkit-mask-size: 14px;
  }
}

@import "../../rtl/include/settings/header";